/*****
 * 
 * MagicCard.java
 * 
 * Copyright (c) 2011 Rocco Nicosia / TwoBit MTG Toolkit. 
 * 
 * License information: http://www.gnu.org/licenses/agpl-3.0-standalone.html
 * 
 *****/

package twobitclient.twobit;

import java.util.ArrayList;

/*****
 * 
 * Stores / manipulates card data. 
 * 
 *****/
public class MagicCard {
    
    private String m_name,
                    m_battleText,
                    // m_flavorText,            not implemented
                    m_rarity,
                    m_artist;
    
    private ArrayList<String> m_abilities = new ArrayList<String>();
    private ArrayList<String> m_subTypes = new ArrayList<String>();
    
    private int m_id,
                m_power,
                m_toughness,
                m_loyalty;
    
    private int[] m_cost = new int[5];
    private SuperType m_superType;
    private Type m_type;
    private ManaType m_manaType;
    
    public enum SuperType {
        BASIC, 
        LEGENDARY, 
        SNOW, 
        TRIBAL,
        WORLD
    }
    
    public enum Type {
        ARTIFACT, 
        CREATURE, 
        ENCHANTMENT, 
        INSTANT, 
        LAND, 
        PLANESWALKER, 
        SORCERY
    }
    
    public enum ManaType {
        COLORLESS, 
        WHITE,
        BLUE,
        BLACK,
        RED,
        GREEN
    }

    public MagicCard(String name, int id)
    {
        m_name = name;
        m_id = id;
    }
    
    @Override
    public String toString()
    {
        return m_name;
    }
    
    public void setType(Type type)
    {
        m_type = type;
    }
    
    public void setManaType(ManaType manaType)
    {
        m_manaType = manaType;
    }
    
    public void setSuperType(SuperType superType)
    {
        m_superType = superType;
    }
    
    public void addSubType(String subType)
    {
        m_subTypes.add(subType);
    }
    
    public void setPower(int power)
    {
        m_power = power;
    }
    
    public void setToughness(int toughness)
    {
        m_toughness = toughness;
    }
    
    public void setLoyalty(int loyalty)
    {
        m_loyalty = loyalty;
    }
    
    public void addAbility(String ability)
    {
        m_abilities.add(ability);
    }
    
    public void addManaCost(ManaType manaType, int value)
    {
        m_cost[manaType.ordinal()] = value;
    }
    
    public void setBattleText(String battleText)
    {
        m_battleText = battleText;
    }
    
    /* Flavor text not implemented. 
    public void setFlavorText(String flavorText)
    {
        m_flavorText = flavorText;
    } */
    
    public void setRarity(String rarity)
    {
        m_rarity = rarity;
    }
    
    public void setArtist(String artist)
    {
        m_artist = artist;
    }
}
    

